home *** CD-ROM | disk | FTP | other *** search
/ Magnum One / Magnum One (Mid-American Digital) (Disc Manufacturing).iso / d12 / bsrc_p1.arc / DOSTIME.ASM < prev    next >
Encoding:
Assembly Source File  |  1988-11-30  |  2.9 KB  |  115 lines

  1. .xlist
  2.         page    64,132
  3.         
  4.         title   DosTime
  5.         subttl  by Wynn Wagner III
  6.         
  7.         name    DosDate
  8.         ;
  9.         ;
  10.         ;
  11.         ; The following macro files come with the MicroSoft "C" compiler
  12.         ;
  13.         include version.inc
  14.         include msdos.inc
  15.         include cmacros.inc
  16.         
  17.         .sall
  18. .list
  19. ;
  20. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  21.  
  22. sBegin   code
  23.  
  24.          assumes  cs,code
  25.          assumes  ds,data
  26.                                 
  27. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  28.  
  29. ;
  30. ;        --------------------------------------------------------------------
  31. ;        void dostime(&hour,&min,&sec,&ths);
  32. ;
  33. ;        int hour;         0-23  military time
  34. ;        int min;       0-59
  35. ;        int sec;          0-59
  36. ;        int ths;          0-99
  37. ;        --------------------------------------------------------------------
  38. cProc    dostime,<PUBLIC>,<di>
  39.  
  40.          parmW    Hour
  41.          parmW    Minutes
  42.          parmW    Seconds
  43.          parmW    Thousandths
  44.  
  45. cBegin
  46.  
  47.          callos   gettime
  48.  
  49.          mov      al,  ch
  50.          xor      ah,  ah
  51.          mov      di,  Hour         ; Address of Hour
  52.          mov      [di],ax
  53.  
  54.          mov      bl,  cl
  55.          xor      bh,  bh
  56.          mov      di,  Minutes      ; Address of Minutes
  57.          mov      [di],bx
  58.  
  59.          mov      cl,  dh
  60.          xor      ch,  ch
  61.          mov      di,  Seconds      ; Address of Seconds
  62.          mov      [di],cx
  63.  
  64.          xor      dh,  dh
  65.          mov      di,  Thousandths  ; Address of Thousandths
  66.          mov      [di],dx
  67.  
  68. cEnd
  69.  
  70. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  71. ;
  72. ;        --------------------------------------------------------------------
  73. ;        void dosdate(&month,&mday,&year,&wday);
  74. ;
  75. ;        int month;       1-12
  76. ;        int mday;       1-31     day of month
  77. ;        int year;       1980-2099
  78. ;        int wday;       0-6   day of week (0=Sun,6=Sat)
  79. ;        --------------------------------------------------------------------
  80. cProc    dosdate,<PUBLIC>,<di>
  81.  
  82.          parmW    Month
  83.          parmW    Mday
  84.          parmW    Year
  85.          parmW    Wday
  86.  
  87. cBegin
  88.  
  89.          callos   getdate
  90.  
  91.          mov      bl,  dh
  92.          xor      bh,  bh
  93.          mov      di,  Month        ; Address of Month
  94.          mov      [di],bx
  95.  
  96.          xor      dh,  dh
  97.          mov      di,  Mday         ; Address of Day-of-Month
  98.          mov      [di],dx
  99.  
  100.          mov      di,  Year         ; Address of Year
  101.          mov      [di],cx
  102.  
  103.          xor      ah,  ah
  104.          mov      di,  Wday         ; Address of Day-of-Week
  105.          mov      [di],ax
  106.  
  107. cEnd
  108.  
  109. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  110.                   
  111. sEnd
  112.          end
  113.  
  114.  
  115.